package com.sentiment.database.bean;

import java.util.Date;

import org.bson.Document;import org.bson.types.ObjectId;

public class InputInfo  {
	@Override
	public String toString() {
		return "InputInfo [_id=" + _id + ", user_id=" + user_id + ", date=" + date + ", url=" + url + ", content="
				+ content + "]";
	}


	public static final String dbName = "PlagiarismDB";
	public static final String collection = "InputInfo";
	
	private ObjectId _id;
	private String user_id;
	private Date date;
	private String url;
	private String content;
	
	public InputInfo(Document doc){
		super();
		_id = doc.getObjectId("_id");
		user_id = doc.getString("user_id");
		date = doc.getDate("date");
		url = doc.getString("url");
		content = doc.getString("content");
		
	}
	
	
	public InputInfo(String user_id, Date date, String url, String content) {
		super();
		this.user_id = user_id;
		this.date = date;
		this.url = url;
		this.content = content;
	}


	public Document toDocument(){
		return new Document("date",date).append("user_id", user_id)
				.append("url", url).append("content", content);
	}


	public String get_id() {
		return _id.toString();
	}


	public void set_id(String _id) {
		this._id = new ObjectId(_id);
	}


	public String getUser_id() {
		return user_id;
	}


	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}


	public Date getDate() {
		return date;
	}


	public void setDate(Date date) {
		this.date = date;
	}


	public String getUrl() {
		return url;
	}


	public void setUrl(String url) {
		this.url = url;
	}


	public String getContent() {
		return content;
	}


	public void setContent(String content) {
		this.content = content;
	}

}
